home *** CD-ROM | disk | FTP | other *** search
/ Power CD / Power CD ATARI-Rechner Lieben.iso / SPEZIAL / GEMVIEW / VERSION.3 / MODULS.SRC / STRCTURE / IMAGE.H next >
Encoding:
Text File  |  1993-10-30  |  3.8 KB  |  72 lines

  1. typedef unsigned long  Pixel;
  2. typedef unsigned short Intensity;
  3. typedef unsigned char  byte;
  4.  
  5. typedef struct rgbmap {
  6.   unsigned int  size;          /* size of map, must be a power of 2 (2^n)   */
  7.   unsigned int  used;          /* number of colors used in RGB map          */
  8.   unsigned char compressed;    /* (internal) image uses colormap fully      */
  9.   unsigned char reserved;      /* Reserved                                  */
  10.   unsigned int  unused16;      /* (internal) color, which will not used     */
  11.   Intensity    *red;           /* color values in range [0..65535]          */
  12.   Intensity    *green;
  13.   Intensity    *blue;
  14. } RGBMap;
  15.  
  16. typedef struct Scaling {
  17.   unsigned       count : 4;    /* use 1 point (a), or 2 (a,b), or 3 (a,b,c) */
  18.   unsigned       a     : 4;    /* range: 0 (lowest) to 7 (highest) position */
  19.   unsigned       b     : 4;    /* see COLORSCALE-Dialog                     */
  20.   unsigned       c     : 4;
  21. } Scaling;
  22.  
  23. /* image structure
  24.  */
  25.  
  26. typedef struct Image {
  27.   char          *title;        /* name of image, set also by new...Image()  */
  28.   unsigned short type;         /* type of image, set by images.new...Image()*/
  29.   unsigned short width;        /* width of image in pixels, set by ...      */
  30.   unsigned short height;       /* height of image in pixels, set by ...     */
  31.   unsigned short depth;        /* depth of image in bits, set by ...        */
  32.   unsigned short unalignwidth; /* (internal) original width after alignment */
  33.   RGBMap         rgb;          /* RGB map of image if IRGB/IGEM type        */
  34.   byte          *data;         /* data rounded to full byte for each row    */
  35.                                /* rounded to full word after alignment      */
  36.   unsigned int   pixlen;       /* length of pixel: Mono/Color:1 ; TC:3      */
  37.   Scaling        scalered;     /* (internal) scaling description for red    */
  38.   Scaling        scalegreen;
  39.   Scaling        scaleblue;
  40.   Scaling        scaleadjust;
  41.   unsigned       alignTo8      : 2; /* image is loaded  8 pixel aligned: 1
  42.                                        image is loaded 16 pixel aligned: 2
  43.                                        width is set to the shown image width*/
  44.   unsigned       fastload      : 1; /* (internal)                           */
  45.   unsigned       loadgdosfonts : 1; /* (internal)                           */
  46.   unsigned       scaleused     : 1; /* (internal)                           */
  47.   unsigned       unused        : 3; /* (internal)                           */
  48.   unsigned       font_point    : 8; /* (internal)                           */
  49. } Image;
  50.  
  51.  
  52. #define IBITMAP    0x0011           /* image is a bitmap                    */
  53. #define IATARIMONO 0x0011           /* image is Atari ST Mono BitPlane      */
  54. #define IATARI_RGB 0x0012           /* image is Atari ST Color BitPlane     */
  55. #define IATARI__TC 0x0013           /* image is Atari ST TrueColor          */
  56. #define ITRUEC     0x0013           /* image is TRUE-color                  */
  57. #define IRGB       0x0014           /* image is RGB                         */
  58.                                     /* All values up to 0x03FF reserved!    */
  59.  
  60. #define BITMAPP(IMAGE)      ((IMAGE)->type == IBITMAP)
  61. #define ATARIMONOP(IMAGE)   ((IMAGE)->type == IATARIMONO)
  62. #define RGBP(IMAGE)         ((IMAGE)->type == IRGB)
  63. #define ATARI_RGBP(IMAGE)   ((IMAGE)->type == IATARI_RGB)
  64. #define TRUECP(IMAGE)       ((IMAGE)->type == ITRUEC)
  65. #define ATARI__TCP(IMAGE)   ((IMAGE)->type == IATARI__TC)
  66.  
  67. #define ATARIRASTERP(IMAGE) ((IMAGE)->type <= ITRUEC)
  68. #define ALL_RASTERP(IMAGE)  ((IMAGE)->type <= IRGB)
  69. #define MONOCHROMEP(IMAGE)  ((IMAGE)->type == IBITMAP)
  70. #define PALETTEP(IMAGE)     ((IMAGE)->type == IATARI_RGB || (IMAGE)->type == IRGB)
  71. #define TRUECOLORP(IMAGE)   ((IMAGE)->type == ITRUEC)
  72.